import os

if __name__ == "__main__":
    path = "/home/ubuntu/Ascend/samples/cplusplus/level1_single_api/3_ir/IRBuild/data/tf"
    # path = "/home/ubuntu/onnx_samples/onnx_transformer/docter/constraints/tf_unhandled"
    om_path = "/home/ubuntu/Ascend/samples/cplusplus/level1_single_api/3_ir/IRBuild/out"
    target_path = "/home/ubuntu/Ascend/samples/cplusplus/level1_single_api/3_ir/IRBuild/data/tf/tf_success"
    # target_path = "/home/ubuntu/onnx_samples/onnx_transformer/docter/constraints/tf_transferred"
    for file_name in os.listdir(path):
        # yml_path = os.path.join(path, file_name)
        if ".pb" not in file_name:
            continue
        pb_path = os.path.join(path, file_name)
        om_file_name = file_name[0:len(file_name) - 3] + ".om"
        if os.path.exists(os.path.join(om_path, om_file_name)):
            os.system("mv %s %s" % (pb_path, target_path))


